package com.wangsh.splider.system.pojo;

import java.util.Date;
import java.util.Map;
import java.util.TreeMap;

import com.wangsh.splider.common.pojo.BasePojo;
import com.wangsh.splider.users.pojo.AAdmins;

public class ASysClient extends BasePojo<ASysClient> {
	private	int 	id;
	private	int 	adminsId;
	private	int 	countryId;
	private int 	ipId;
	private String 	port;
	private byte	sourceType;
	private int		totalNum;
	private int 	succedNum;
	private int 	failedNum;
	private int 	todayTotalNum;
	private int 	todaySuccedNum;
	private int 	todayFailedNum;
	private String 	content;
	private byte 	status;
	private Date 	createTime;
	private Date 	updateTime;
	private Date 	pubTime;
	private Date	attackTime;
	
	//关联关系	管理员表	国家表	IP表
	private AAdmins admins;
	private ASysCountry country;
	private ASysIp ip;
	
	public AAdmins getAdmins() {
		return admins;
	}

	public void setAdmins(AAdmins admins) {
		this.admins = admins;
	}

	public ASysCountry getCountry() {
		return country;
	}

	public void setCountry(ASysCountry country) {
		this.country = country;
	}

	public ASysIp getIp() {
		return ip;
	}

	public void setIp(ASysIp ip) {
		this.ip = ip;
	}
	/*--字符串表示--*/
    private String statusStr ;
    private String typeStr ;
    /* 存储所有状态的容器 */
    private Map<String,String> enumsMap = new TreeMap<String, String>();

    public Map<String, String> getEnumsMap()
    {
        // 根据状态值获取字符串描述
        ASysClientEnum[] aSysClientEnums = ASysClientEnum.values();
        for (int i = 0; i < aSysClientEnums.length; i++)
        {
        	ASysClientEnum aSysClientEnum = aSysClientEnums[i];
            String key = aSysClientEnum.toString() ;
            if(key.lastIndexOf("_") != -1)
            {
                key = key.substring(0,key.lastIndexOf("_")) ;
            }
            enumsMap.put(key + "-" + aSysClientEnum.getStatus() + "", aSysClientEnum.getName());
        }
        return enumsMap;
    }

    public String getStatusStr()
    {
        // 根据状态值获取字符串描述
    	ASysClientEnum[] aSysClientEnums = ASysClientEnum.values();
        for (int i = 0; i < aSysClientEnums.length; i++)
        {
        	ASysClientEnum aSysClientEnum = aSysClientEnums[i];
            if (aSysClientEnum.toString().startsWith("STATUS_"))
            {
                // 表示是状态的标识
                if (aSysClientEnum.getStatus() == this.getStatus())
                {
                    this.statusStr = aSysClientEnum.getName();
                    break;
                }
            }
        }
        return statusStr;
    }
	
    public String getTypeStr()
    {
        // 根据状态值获取字符串描述
    	ASysClientEnum[] aSysClientEnums = ASysClientEnum.values();
        for (int i = 0; i < aSysClientEnums.length; i++)
        {
        	ASysClientEnum aSysClientEnum = aSysClientEnums[i];
            if (aSysClientEnum.toString().startsWith("SOURCETYPE_"))
            {
                // 表示是状态的标识
                if (aSysClientEnum.getStatus() == this.getSourceType())
                {
                    this.typeStr = aSysClientEnum.getName();
                    break;
                }
            }
        }
        return typeStr;
    }
    
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public int getAdminsId() {
		return adminsId;
	}
	public void setAdminsId(int adminsId) {
		this.adminsId = adminsId;
	}
	public int getCountryId() {
		return countryId;
	}
	public void setCountryId(int countryId) {
		this.countryId = countryId;
	}
	public int getIpId() {
		return ipId;
	}
	public void setIpId(int ipId) {
		this.ipId = ipId;
	}
	public String getPort() {
		return port;
	}
	public void setPort(String port) {
		this.port = port;
	}
	public int getTotalNum() {
		return totalNum;
	}
	public void setTotalNum(int totalNum) {
		this.totalNum = totalNum;
	}
	public int getSuccedNum() {
		return succedNum;
	}
	public void setSuccedNum(int succedNum) {
		this.succedNum = succedNum;
	}
	public int getFailedNum() {
		return failedNum;
	}
	public void setFailedNum(int failedNum) {
		this.failedNum = failedNum;
	}
	public int getTodayTotalNum() {
		return todayTotalNum;
	}
	public void setTodayTotalNum(int todayTotalNum) {
		this.todayTotalNum = todayTotalNum;
	}
	public int getTodaySuccedNum() {
		return todaySuccedNum;
	}
	public void setTodaySuccedNum(int todaySuccedNum) {
		this.todaySuccedNum = todaySuccedNum;
	}
	public int getTodayFailedNum() {
		return todayFailedNum;
	}
	public void setTodayFailedNum(int todayFailedNum) {
		this.todayFailedNum = todayFailedNum;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public byte getStatus() {
		return status;
	}
	public void setStatus(byte status) {
		this.status = status;
	}
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	public Date getUpdateTime() {
		return updateTime;
	}
	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}
	public Date getPubTime() {
		return pubTime;
	}
	public void setPubTime(Date pubTime) {
		this.pubTime = pubTime;
	}
	
	public byte getSourceType() {
		return sourceType;
	}

	public void setSourceType(byte sourceType) {
		this.sourceType = sourceType;
	}

	public Date getAttackTime()
	{
		return attackTime;
	}

	public void setAttackTime(Date attackTime)
	{
		this.attackTime = attackTime;
	}
	

}
